package com.hanrui.android.fragment.message.audit.emp;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.hanrui.android.R;
import com.hanrui.android.library.base.BaseFragment;
import com.hanrui.android.model.EmpQuitDetailBean;
import com.hanrui.android.net.contract.message.audit.emp.EmpQuitDetailContract;
import com.hanrui.android.net.presenter.message.audit.emp.EmpQuitDetailPresenter;

import butterknife.BindView;

/**
 * 离职审批基本信息
 *
 */

public class EmpQuitDetailFragment extends BaseFragment<EmpQuitDetailPresenter> implements EmpQuitDetailContract.View {
    @BindView(R.id.main_title)
    TextView mainTitle;
    @BindView(R.id.subhead_title)
    TextView subheadTitle;
    @BindView(R.id.name)
    TextView name;
    @BindView(R.id.thing_title)
    TextView thingTitle;
    @BindView(R.id.time)
    TextView time;
    @BindView(R.id.page_num)
    TextView pageNum;
    @BindView(R.id.copies_num)
    TextView copiesNum;
    @BindView(R.id.leaders)
    TextView leaders;
    @BindView(R.id.time_limit)
    TextView timeLimit;
    @BindView(R.id.record_company)
    TextView recordCompany;
    @BindView(R.id.reson)
    TextView reson;
    @BindView(R.id.duty_people)
    TextView duty_people;

    String taskId,procInsId,bizId;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_empquitdetail;
    }

    @Override
    protected void initInjector() { mFragmentComponent.inject(this); }

    @Override
    protected void initView(View view) {

        taskId = getArguments().getString("taskId");
        procInsId = getArguments().getString("procInsId");
        bizId = getArguments().getString("bizId");

        mPresenter.empQuitBizDetail(getActivity(),taskId,procInsId,bizId);

    }



    public static EmpQuitDetailFragment newInstance(String taskId, String procInsId, String bizId) {
        EmpQuitDetailFragment fragment = new EmpQuitDetailFragment();
        Bundle bundle = new Bundle();
        bundle.putString("taskId", taskId);
        bundle.putString("procInsId", procInsId);
        bundle.putString("bizId", bizId);
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public void empQuitBizDetail(EmpQuitDetailBean data) {

        if (null != data) {

            mainTitle.setText(data.getDetail().getEmpName());
            subheadTitle.setText(data.getDetail().getQuitDate());
            name.setText(data.getDetail().getTitle());
            thingTitle.setText(data.getDetail().getEmpName());
            time.setText(data.getDetail().getOfficeName());
            pageNum.setText(data.getDetail().getQuitDate());
            copiesNum.setText(data.getDetail().getUserTypeName());
            leaders.setText(data.getDetail().getEntryDate());
            timeLimit.setText(data.getDetail().getHasLoan());
            recordCompany.setText(data.getDetail().getHasGoods());
            reson.setText(data.getDetail().getQuitCause());
            duty_people.setText(data.getDetail().getRemark());

        }

    }


}
